from selenium import webdriver
from selenium.webdriver.common.by import By
import time
'''
前台地址：http://192.168.1.241/hdshop     
后台地址：http://192.168.1.241/hdshop/admin/（admin/hdxy2018）
'''
#初始化
driver = webdriver.Chrome()
driver.get("http://192.168.1.241/hdshop")
driver.maximize_window()
#进入登录页面
driver.find_element(By.LINK_TEXT,"登录").click()
#填写登录信息:
driver.find_element(By.NAME,"username").send_keys("liuhaitao") #输入用户名
driver.find_element(By.NAME,"password").send_keys("123456") #输入密码
driver.find_element(By.NAME,"submit").click() # 点击登录
time.sleep(15)
driver.quit()





